package link.jfire.socket.socketserver.handler.impl;

import javax.annotation.Resource;
import link.jfire.baseutil.simplelog.ConsoleLogFactory;
import link.jfire.baseutil.simplelog.Logger;
import link.jfire.socket.socketserver.bus.BusinessCommand;
import link.jfire.socket.socketserver.handler.EntryHandler;
import link.jfire.socket.socketserver.storage.Entry;

@Resource
public class TestHandler implements EntryHandler
{
    private static int    flag   = 0;
    private static Logger logger = ConsoleLogFactory.getLogger();
    
    @Override
    public byte interestedDataPacketType()
    {
        return BusinessCommand.TEST_SERVER;
    }
    
    @Override
    public void handler(Entry entry)
    {
        logger.debug("进行测试处理");
        entry.getBusinessData().ensureCapacity(4096);
        flag++;
        logger.debug("第" + flag + "次测试");
    }
    
}
